Skip to content

fix: trigger a redraw from icon layer once the icons are loaded. - #3269

Merged
igorDykhta merged 6 commits into
masterfrom
igr/trigger-redraw-from-layer
Dec 24, 2025
Merged

fix: trigger a redraw from icon layer once the icons are loaded.#3269
igorDykhta merged 6 commits into
masterfrom
igr/trigger-redraw-from-layer

Conversation

@igorDykhta

Copy link
Copy Markdown
Collaborator

Current behavior: the user has to move the mouse or perform another action to trigger a redraw.
With the fix: trigger a redraw from icon layer once the icons are loaded.

Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
Copilot AI review requested due to automatic review settings December 24, 2025 12:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes an issue where icon layers don't automatically redraw when icons finish loading asynchronously. Previously, users had to manually trigger a redraw (e.g., by moving the mouse). The fix introduces a new onForceUpdate callback mechanism that allows the icon layer to request a map redraw once the icons are loaded.

  • Adds onForceUpdate callback to layer callback types
  • Implements callback in icon layer to trigger redraw after icon loading
  • Connects callback through map container to trigger map state updates

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 6 comments.

File Description
src/types/layers.d.ts Adds onForceUpdate callback definitions to LayerCallbacks and BindedLayerCallbacks types
src/layers/src/icon-layer/icon-layer.ts Stores the onForceUpdate callback in renderLayer and calls it in setSvgIcons after icons load to trigger map redraw
src/components/src/map-container.tsx Implements _onForceUpdate method and registers it in layer callbacks to trigger map updates

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/layers/src/icon-layer/icon-layer.ts Outdated
Comment thread src/components/src/map-container.tsx Outdated
Comment thread src/components/src/map-container.tsx Outdated
Comment thread src/layers/src/icon-layer/icon-layer.ts Outdated
Comment thread src/components/src/map-container.tsx Outdated
Comment thread src/layers/src/icon-layer/icon-layer.ts Outdated
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
Signed-off-by: Ihor Dykhta <dikhta.igor@gmail.com>
@igorDykhta
igorDykhta merged commit 81f490d into master Dec 24, 2025
8 checks passed
@igorDykhta
igorDykhta deleted the igr/trigger-redraw-from-layer branch December 24, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants